﻿#pragma strict
import System;

var resolutions:Resolution[];
var isFull:boolean;
var curRes:Resolution;

function Start () {
	resolutions = Screen.resolutions;
}

function OnGUI () {
	isFull = GUILayout.Toggle(isFull,"fullscreen switch");
	
	for(var res:Resolution in resolutions){
		var isPress = GUILayout.Button(String.Format("w:{0},h:{1},r:{2}",res.width,res.height,res.refreshRate));
		if(isPress){
			curRes = res;
			Screen.SetResolution(res.width,res.height,isFull);
		}
	}
	
	GUI.Box(Rect(Screen.width * 0.7,30,200,30),String.Format("w:{0},h:{1},r:{2}",curRes.width,curRes.height,curRes.refreshRate));
	
	if(Event.current.keyCode == KeyCode.Escape){
		Application.Quit();
	}
}